import api from '../../fetch/api'
import * as types from '../mutation-types';

const state = {
	newsDetail:{}
}

const actions = {
    getNewsDetail({ commit }, param) {
        api.get_news_detail(param).then(res => {
            commit(types.GET_NEWS_DETAIL, res)
            
        })
    }
}

const getters = {
    newsDetail: state => state.newsDetail
}

const mutations = {
    [types.GET_NEWS_DETAIL](state, res) {
        state.newsDetail = res.data
    },
}

export default {
    state,
    actions,
    getters,
    mutations,
}